<template>
  <div class="pointCustomSettingsManager">
    <basic-container>
      <avue-crud :option="option"
                 :table-loading="loading"
                 :data="data"
                 :page.sync="page"
                 :permission="permissionList"
                 :before-open="beforeOpen"
                 v-model="form"
                 ref="crud"
                 @row-update="rowUpdate"
                 @row-save="rowSave"
                 @row-del="rowDel"
                 @search-change="searchChange"
                 @search-reset="searchReset"
                 @selection-change="selectionChange"
                 @current-change="currentChange"
                 @size-change="sizeChange"
                 @refresh-change="refreshChange"
                 @on-load="onLoad">
        <template slot="menuLeft">
          <el-button type="danger" size="small" icon="el-icon-delete" plain v-if="permission.pointcustomsettings_delete" @click="handleDelete">删 除</el-button>
        </template>

        <!-- 点位类型自定义 -->
        <template slot-scope="scope" slot="dwlxForm">
          <el-select v-model="form.dwlx" placeholder="请选择点位类型" :disabled="form.dwlx===3?true:false">
            <el-option
              v-for="item in dwlxOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value"
              :disabled="item.disabled">
            </el-option>
          </el-select>
        </template>

        <!-- 点位名称自定义 -->
        <template slot-scope="scope" slot="dwdmForm">
          <el-input v-model="form.dwdm" placeholder="请输入点位名称" v-if="obj.value" :disabled="form.dwlx===3?true:false"></el-input>
          <el-select v-model="form.dwdm" placeholder="请选择点位名称" v-if="!obj.value" clearable size="small">
            <el-option
              v-for="(item, index) in getDwmcList"
              :key="index"
              :label="item.name"
              :value="item.code"
              :disabled="item.disabled">
            </el-option>
          </el-select>
        </template>

        <!-- 地图表单自定义 -->
        <template slot="deptMapForm">
          <div v-if="deptShowMap">
            <baidu-map class="map" :center="center" :zoom="zoom" @ready="productionSiteHandler">
              <el-input placeholder="关键词查询" v-model="searchWord" style="position:absolute;top:10px;left:10px;width:180px;">
                <template slot="append">
                  <el-button icon="el-icon-search" id="citySearch"></el-button>
                </template>
              </el-input>

              <bm-navigation anchor="BMAP_ANCHOR_TOP_RIGHT"></bm-navigation>
              <bm-marker :position="mapPosition" :dragging="true"></bm-marker>
            </baidu-map>
          </div>
        </template>

        <template slot="idsLabel">
          <span style="color:#F56C6C">*</span><span>巡检内容:</span>
        </template>
        <template slot="idsForm">
          <el-form label-width="0px">
            <el-button type="success" size="small" @click="handlePatrol">添加 巡检内容</el-button>
            <span v-if="patrolTagsErr" class="patrol_error">请添加巡检内容</span>
          </el-form>
        </template>

        <!-- 巡检内容表单自定义 -->
        <template slot="xjnrContentForm">
          <div v-if="xjnrData.length!=0">
            <avue-crud
              :option="xjnrOption"
              :data="xjnrData"
              ref="xjnrCrud">
              <!-- 自定义操作列：删除按钮 -->
              <template slot="menu" slot-scope="scope">
                <el-button type="danger" icon="el-icon-delete" size="small" :disabled="dialogType === viewLabel" @click="handleDeleteXjnr(scope.row, scope.index)">删 除</el-button>
              </template>
              <!-- 检查项目自定义 -->
              <template slot="xjxm" slot-scope="scope">
                <el-input placeholder="请选择检查项目" v-model="scope.row['xjxm']" clearable size="small" :disabled="true"></el-input>
              </template>
            </avue-crud>
          </div>
        </template>

        <!-- 二维码表格自定义 -->
        <template slot="bdewm" slot-scope="scope">
          <div>
            <el-button type="text" size="small" icon="el-icon-picture-outline" v-if="scope.row['bdewm'] === ''" @click="generateXjewmCode(scope.row['id'])">生成二维码</el-button>
            <el-button type="text" size="small" icon="el-icon-view" v-else @click="handleViewXjewmCode(scope.row)">查 看</el-button>
          </div>
        </template>

      </avue-crud>

      <!-- 绑定巡检内容弹窗 -->
      <el-dialog title="绑定 巡检内容" :visible.sync="dialogPatrol" append-to-body @close='closeDialog' width="1200px" class="item">
        <avue-crud :option="patrolOption"
                   :table-loading="patrolLoading"
                   :data="patrolData"
                   :page.sync="patrolPage"
                   ref="patrolCrud"
                   @search-change="patrolSearchChange"
                   @search-reset="patrolSearchReset"
                   @selection-change="patrolSelectionChange"
                   @current-change="patrolCurrentChange"
                   @size-change="patrolSizeChange">
        </avue-crud>
        <span slot="footer" class="dialog-footer">
          <el-button @click="closeDialog">取 消</el-button>
          <el-button type="primary" @click="choosePatrol()">确 定</el-button>
        </span>
      </el-dialog>

      <!-- 弹窗：图片 -->
      <viewpicture
        :localPicBox="localPicBox"
        :localPictures="localPictures"
        :viewPicTitle="viewPicTitle"
        @confirmViewPicture="confirmViewPicture"
        @handleClosePicBox="handleClosePicBox">
      </viewpicture>

    </basic-container>
  </div>
</template>

<script>
  import {getList, getDetail, add, update, remove, getPatrolSList, generateCode, getDwmcList} from "@/api/xjgl/pointcustomsettings";
  import viewpicture from "@/views/saferisk/components/viewpicture";
  import {getDeptList} from "@/api/mmhi/major_dangerous_sources";
  import {mapGetters} from "vuex";

  const tenantId = JSON.parse(localStorage.getItem("saber-tenantId")).content;

  export default {
    components: {
      viewpicture
    },
    data() {
      return {
        form: {},
        query: {},
        loading: true,

        // 弹窗：查看图片
        localPicBox: false,
        localPictures: [],
        viewPicTitle: "",

        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        selectionList: [],
        dwlxOptions: [{
          value: 1,
          label: '公共类'
        }, {
          value: 2,
          label: '风险点'
        }, {
          value: 3,
          label: '重大危险源',
          disabled: true
        }, {
          value: 4,
          label: '设备设施'
        }, {
          value: 5,
          label: '关键装置重点部位'
        }],

        getDwmcList:[],
        obj:{
          value:true
        },

        xjnrData: [],
        xjnrOption: {
          calcHeight: 30,
          tip: false,
          index: true,
          selection: false,
          addBtn: false,
          refreshBtn: false,
          columnBtn: false,
          indexWidth: 30,
          editBtn: false,
          delBtn: false,
          menuWidth: 100,
          column: [
            {
              label: "主键",
              prop: "id",
              align:"center",
              hide:true,
              maxlength:50,
            },
            {
              label: "检查项目",
              prop: "xjxm",
              align:"center",
              slot:true,
              maxlength:50,
            }
          ]
        },

        option: {
          height:'auto',
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          dialogClickModal: false,
          column: [
            {
              label: "点位类型",
              prop: "dwlx",
              type: "select",
              formslot: true,
              search: true,
              dataType: "number",
              align: "center",
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=pointCustomSettings_dwlx",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              rules: [{
                required: true,
                message: "请选择点位类型",
                trigger: "blur"
              }]
            },
            {
              label: "点位名称",
              prop: "dwmc",
              search: true,
              align: "center",
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false
            },
            {
              label: "点位名称",
              prop: "dwdm",
              align: "center",
              maxlength:50,
              hide: true,
              formslot: true,
              rules: [{
                required: true,
                message: "请输入点位名称",
                trigger: "blur"
              }]
            },
            {
              label: "所在部门",
              prop: "szbm",
              align: "center",
              type:"tree",
              dicData: [],
              props: {
                label: "title"
              },
              checkStrictly: true,
              rules: [{
                required: true,
                message: "请选择所在部门",
                trigger: "blur"
              }]
            },
            {
              label: "点位编号",
              prop: "dwbh",
              maxlength:50,
              align: "center",
              rules: [{
                required: true,
                message: "请输入点位编号",
                trigger: "blur"
              }]
            },
            {
              label: "二维码",
              prop: "bdewm",
              align: "center",
              display: false,
              slot: true,
              width: 110
            },
            {
              label: "绑定区域",
              prop: "bdqy",
              maxlength:50,
              align: "center",
              row: true,
              rules: [{
                required: true,
                message: "请输入绑定区域",
                trigger: "blur"
              }]
            },
            {
              label: '',
              prop: 'deptMap',
              span: 24,
              hide: true,
              formslot: true,
            },
            {
              label: "纬度",
              prop: "wd",
              width:90,
              align: "center",
              readonly:true,
              rules: [{
                required: true,
                message: "请输入纬度",
                trigger: "blur"
              }],
            },
            {
              label: "经度",
              prop: "jd",
              width:90,
              align: "center",
              readonly:true,
              rules: [{
                required: true,
                message: "请输入经度",
                trigger: "blur"
              }],
            },
            {
              label: "巡检内容",
              prop: "ids",
              align: "center",
              hide: true,
              viewDisplay: false,
              formslot:true,
              labelslot:true
            },
            {
              label: "",
              prop: "xjnrContent",
              align: "center",
              span: 24,
              hide: true,
              formslot: true
            },
            {
              label: "备注",
              prop: "bz",
              align: "center",
              maxlength:1000,
              type: "textarea",
              span: 24,
              minRows: 6,
              hide: true
            },
            {
              label: "企业id",
              prop: "bladeDeptId",
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false
            },
            {
              label: "租户id",
              prop: "tenantId",
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false
            },
            {
              label: "创建人",
              prop: "createUser",
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false
            },
            {
              label: "创建部门",
              prop: "createDept",
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false
            },
            {
              label: "创建时间",
              prop: "createTime",
              hide: true,
              addDisplay: false,
              editDisplay: false,
              viewDisplay: false
            }
          ]
        },
        data: [],

        dialogType: "",
        viewLabel: "view",

        zoom: 10,
        dragging: false,
        deptShowMap: true,
        searchWord: "",

        dialogPatrol: false,
        patrolQuery: {},
        patrolLoading: true,
        patrolPage: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        patrolSelectionList: [],
        patrolOption: {
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          menu: false,
          addBtn: false,
          viewBtn: true,
          selection: true,
          dialogClickModal: false,
          refreshBtn: false,
          columnBtn: false,
          column: [
            {
              label: "巡检类型",
              prop: "xjblx",
              align: "center",
              search: true
            },
            {
              label: "巡检级别",
              prop: "xjjb",
              align: "center",
              search: true
            },
            {
              label: "检查项目",
              prop: "xjxm",
              align: "center",
              search: true
            },
            {
              label: "检查状态",
              prop: "jczt",
              dicData: [{
                label: "正常",
                value: 0
              }, {
                label: "异常",
                value: 1
              }],
              align: "center",
            }
          ]
        },
        patrolData: [],
        patrolTags: [],
        patrolTagsErr: false,
        selectPatrol: {},

        mapPosition: {
          lng: 121.4472540000,
          lat: 31.3236200000
        },
        center: {
          lng: 121.4472540000,
          lat: 31.3236200000
        }

      };
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.pointcustomsettings_add, false),
          viewBtn: this.vaildData(this.permission.pointcustomsettings_view, false),
          delBtn: this.vaildData(this.permission.pointcustomsettings_delete, false),
          editBtn: this.vaildData(this.permission.pointcustomsettings_edit, false)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    },
    mounted() {
      this.initData();
    },
    methods: {
      // 初始化数据
      initData() {
        getDeptList(tenantId).then(res => {
          const column = this.findObject(this.option.column, "szbm");
          column.dicData = res.data.data;
        }).then(() => {

        });
      },

      // 地图处理事件
      productionSiteHandler({BMap, map}) {
        let _this = this;
        map.addEventListener('click', function(e) {
          _this.form.jd = e.point.lng
          _this.form.wd = e.point.lat
        });
        _this.$nextTick(() => {
          document.getElementById('citySearch').addEventListener('click', function() {
            let localSearch = new BMap.LocalSearch(map)
            localSearch.setSearchCompleteCallback(searchResult => {
              let poi = searchResult.getPoi(0)
              if(!poi) {
                return _this.$message.warning('该地址不存在')
              } else {
                _this.center = {
                  lng: poi.point.lng,
                  lat: poi.point.lat
                }
                _this.form.jd = poi.point.lng
                _this.form.wd = poi.point.lat
              }
            });
            localSearch.search(_this.searchWord);
          });
        })
      },

      // 生成二维码
      generateXjewmCode(id) {
        this.$confirm("确定将选择巡检点生成二维码?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          generateCode(id).then(res => {
            if (res.data.success) {
              this.$message.success("二维码生成成功!");
              this.page.currentPage = 1;
              this.onLoad(this.page);
            }
          });
        });
      },

      // 查看二维码
      handleViewXjewmCode(row) {
        getDetail(row.id).then(res => {
          let resData = res.data.data;
          if (res.data.success && resData.ewCode && resData.ewCode.fileUrl) {
            this.localPictures = [resData.ewCode];
            this.localPicBox = true;
            this.viewPicTitle = "二维码";
          }
        });
      },

      // 确认照片
      confirmViewPicture() {
        this.localPictures = [];
        this.localPicBox = false;
        this.viewPicTitle = "";
      },

      // 关闭弹窗
      handleClosePicBox() {
        this.confirmViewPicture();
      },

      // 打开选择巡检内容弹窗
      handlePatrol() {
        this.dialogPatrol = true;
        this.patrolOnLoad(this.patrolPage);
      },

      // 关闭选择巡检内容弹窗
      closeDialog() {
        this.patrolPage.currentPage = 1;
        this.dialogPatrol = false;
        this.patrolSelectionClear();
      },

      // 巡检内容获取表格数据
      patrolOnLoad(page, params = {}) {
        this.patrolLoading = true;
        getPatrolSList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.patrolPage.total = data.total;
          this.patrolData = data.records;
          this.patrolLoading = false;
          this.$nextTick(() => {
            this.patrolData.forEach(row => {
              this.xjnrData.forEach(item => {
                if(item.patrolContentLibraryId===row.id){
                  this.$refs.patrolCrud.toggleRowSelection(row, true);
                }
              })
            });
          });
        });
      },

      // 巡检内容清空勾选
      patrolSelectionClear() {
        this.patrolSelectionList = [];
        this.$refs.patrolCrud.toggleSelection();
      },

      // 巡检内容搜索条件改变事件
      patrolSearchChange(params, done) {
        this.patrolQuery = params;
        this.patrolPage.currentPage = 1;
        this.patrolOnLoad(this.patrolPage, params);
        done();
      },

      // 巡检内容清空搜索条件
      patrolSearchReset() {
        this.patrolQuery = {};
        this.patrolOnLoad(this.patrolPage);
      },

      // 巡检内容勾选
      patrolSelectionChange(list) {
        this.patrolSelectionList = list;
      },

      // 巡检内容换页数
      patrolCurrentChange(currentPage){
        const pageSelectIds = [];
        const pageAllIds = [];
        this.patrolSelectionList.forEach(item => {
          this.selectPatrol[item.id] = item;
          pageSelectIds.push(item.id);
        });
        this.patrolData.forEach(item => {
          pageAllIds.push(item.id);
        });
        for(let id in this.selectPatrol) {
          if(pageSelectIds.indexOf(id) < 0 && pageAllIds.indexOf(id) >= 0) {
            delete this.selectPatrol[id];
          }
        }
        this.patrolPage.currentPage = currentPage;
        this.patrolOnLoad(this.patrolPage);
      },

      // 巡检内容换每页显示数量
      patrolSizeChange(pageSize){
        this.patrolPage.pageSize = pageSize;
        this.patrolOnLoad(this.patrolPage);
      },

      // 选择巡检内容
      choosePatrol() {
        const pageSelectIds = [];
        const pageAllIds = [];
        this.patrolSelectionList.forEach(item => {
          this.selectPatrol[item.id] = item;
          pageSelectIds.push(item.id);
        });
        this.patrolData.forEach(item => {
          pageAllIds.push(item.id);
        });
        for(let id in this.selectPatrol) {
          if(pageSelectIds.indexOf(id) < 0 && pageAllIds.indexOf(id) >= 0) {
            delete this.selectPatrol[id];
          }
        }
        if(this.selectPatrol === undefined || JSON.stringify(this.selectPatrol) === "{}") {
          this.$message.warning("请选择巡检内容");
          return;
        }
        this.patrolTagsErr = false;
        this.patrolTags = [];
        for(let id in this.selectPatrol) {
          this.patrolTags.push(this.selectPatrol[id]);
        }
        this.closeDialog();
        this.xjnrData = [];
        this.patrolTags.forEach(item => {
          this.xjnrData.push({
            patrolContentLibraryId: item.id,
            xjxm: item.xjxm
          });
        });
      },

      // 删除巡检内容
      handleDeleteXjnr(row, index) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          this.xjnrData.splice(index, 1);
        });
      },

      rowSave(row, done, loading) {
        if (this.xjnrData.length === 0) {
          this.$message.warning("请添加巡检内容!");
          loading();
          return;
        }
        for (let key in row) {
          if (key.indexOf("$") >= 0) {
            delete row[key];
          }
        }
        row["xjnrList"] = [];
        this.xjnrData.forEach(item => {
          let measure = {
            patrolContentLibraryId: item.patrolContentLibraryId,
            xjxm: item.xjxm
          };
          row.xjnrList.push(measure);
        });
        this.getDwmcList.forEach(item => {
          if(item.code === row.dwdm){
            row.dwmc = item.name;
          }
        });
        if(row.dwmc==""){
          row.dwmc = row.dwdm
        }
        add(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          loading();
          window.console.log(error);
        });
      },

      rowUpdate(row, index, done, loading) {
        if (this.xjnrData.length === 0) {
          this.$message.warning("请添加巡检内容!");
          loading();
          return;
        }
        for (let key in row) {
          if (key.indexOf("$") >= 0) {
            delete row[key];
          }
        }
        row["xjnrList"] = [];
        this.xjnrData.forEach(item => {
          let measure = {
            patrolContentLibraryId: item.patrolContentLibraryId,
            xjxm: item.xjxm
          };
          row.xjnrList.push(measure);
        });
        if(row.dwlx == 2){
          this.getDwmcList.forEach(item => {
            if(item.code === row.dwdm){
              row.dwmc = item.name;
            }
          });
        }else{
          row.dwmc = row.dwdm;
        }
        update(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          loading();
          console.log(error);
        });
      },

      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },

      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
      },

      beforeOpen(done, type) {
        this.xjnrData=[];
        if(type === "add") {
          this.deptShowMap = true;
          this.mapPosition = {
            lng: 121.4472540000,
            lat: 31.3236200000
          };
          this.center = {
            lng: 121.4472540000,
            lat: 31.3236200000
          };
          this.obj.value = true;
        } else {
          if(type === "edit") {
            this.deptShowMap = true;
            this.mapPosition = {
              lng: this.form.jd ==='' ? this.form.jd : 121.4472540000,
              lat: this.form.wd ==='' ? this.form.wd : 31.3236200000
            };
            this.center = {
              lng: this.form.jd ==='' ? this.form.jd : 121.4472540000,
              lat: this.form.wd ==='' ? this.form.wd : 31.3236200000
            };
            this.zoom = 10;
          } else if(type === "view") {
            this.deptShowMap = false;
          }
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
            this.xjnrData = this.form.xjnrList;
          });
        }
        this.dialogType = type;
        done();
      },

      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
      }
    },
    watch: {
      // 表单经度
      'form.jd' (val) {
        if(val) {
          this.mapPosition.lng = val / 1
        }
      },
      // 表单纬度
      'form.wd' (val) {
        if(val) {
          this.mapPosition.lat = val / 1
        }
      },
      'form.dwlx':{
        handler(val){
          if(val!='' && val!=undefined && val!=null){
            if(val==2){
              this.form.dwdm = "";
              this.obj.value = false;
            }else{
              this.form.dwdm = "";
              this.obj.value = true;
            }
            getDwmcList(this.form.dwlx).then(res => {
              this.getDwmcList = res.data.data;
            }).then(() => {
              this.onLoad(this.page);
            });
          }
        },
        immediate: true
      }
    }
  };
</script>

<style lang="scss">
  .pointCustomSettingsManager {
    .el-form-item__label {
      width: 95px !important;
    }

    .avue-form__row {
      .el-form-item__content {
        margin-left: 95px !important;
      }
    }
  }

</style>

<style lang="scss" scpoed>
  .avue-crud__dialog {
    .el-dialog__body {
      .el-form-item__label {
        width: 85px !important;
      }

      .avue-form__row {
        .el-form-item__content {
          margin-left: 85px !important;
        }
      }
    }
  }

  .el-dialog__wrapper {
    .el-dialog__body {
      padding: 10px 20px 20px 20px;

      .el-form-item__label {
        width: 72px;
      }

      .avue-form__row {
        .el-form-item__content {
          margin-left: 72px;
        }
      }

      .avue-crud__menu {
        display: none;
      }
    }
  }

  .map {
    width: 100%;
    height: 500px;
  }

  .patrol_error {
    color: #F56C6C;
    font-size: 12px;
    margin-left: 5px;
  }

</style>
